<header id="topbar">
    <div class="topbar-left">
        <ol class="breadcrumb">
            <li class="crumb-active">
                <a href="<%= window.location.href %>">每日转转转数据</a>
            </li>
        </ol>
    </div>
    <div class="topbar-right">
        <button class="btn btn-default btn-sm light fw600 ml10" type="button" id="freshBtn">更新数据</button>
    </div>
</header>
<section id="content">
<div class="panel">
    <form class="form-horizontal">
        <div class="form-group">
            <div class="col-md-11">
                <input type="text" id="dateFilter" name="dateFilter" class="form-control text-center" value="<%= options.date_range['0'] %> ~ <%= options.date_range['1'] %>">
            </div>
            <div class="col-md-1">
                <input type="button" id="search" class="btn btn-primary btn-block form-control" value="提交">
            </div>
        </div>
    </form>
</div>

<div class="panel">
    <div class="panel-heading">
        <span class="panel-icon"><i class="fa fa-gear text-primary"></i>
        </span>
        <span class="panel-title">数据表格</span>
    </div>
    <div class="panel-body">
        <table class="table table-striped fs13">
            <thead>
                <tr class="bg-light">
                    <th>日期</th>
                    <th>开奖期数</th>
                    <th>参与人数</th>
                    <th>累计参与</th>
                    <!--<th>累计中奖次数</th>-->
                    <th>累计中奖</th>
                    <!--<th>抽水</th>-->
                    <th>抽水率</th>
                    <th>调整次数</th>
                    <th>原始中奖</th>
                    <th>原始抽水率</th>
                    <th>盈利用户人数</th>
                    <th>盈利用户金额</th>
                    <th>亏损用户人数</th>
                    <th>亏损用户金额</th>
                </tr>
            </thead>
            <tbody class="admin-form">
                <% _.each(items, function(item){
                    pro = ((item.bet_amount-item.origin_award)*100/item.bet_amount);
                    bet_win = item.bet_amount - item.win_amount;%>
                    <tr>
                        <td><%= item._id %></td>
                        <td><%= item.count %></td>
                        <td><%= item.real_user_count %></td>
                        <td><%= item.bet_amount %></td>
                        <!--<td><%= item.win_count %></td>-->
                        <td><%= item.win_amount %></td>
                        <!--<td><%= isNaN(bet_win)? 0: bet_win %></td>-->
                        <td><%= isNaN(item.profit_rate) ? 0:(item.profit_rate * 100).toFixed(2) %>%</td>
                        <td>0</td>
                        <td><%= item.origin_award %></td>
                        <td><%= isNaN(pro) ? 0:pro.toFixed(2) %>%</td>
                        <td><%= item.gain_count %></td>
                        <td><%= item.gain_amount %></td>
                        <td><%= item.lose_count %></td>
                        <td><%= item.lose_amount %></td>
                    </tr>
                <% }) %>
            </tbody>
        </table>
    </div>
</div>

<div class="panel">
    <div class="panel-heading">
        <span class="panel-icon"><i class="fa fa-gear text-primary"></i>
        </span>
        <span class="panel-title">分布图</span>
    </div>
    <div class="panel-body">
        <div class="row">
            <div class="col-md-6">
                <div id="bet_dist"></div>
            </div>
            <div class="col-md-6">
                <div id="bet_index_count"></div>
            </div>
        </div>
        <div class="row">
            <div class="col-md-6">
                <div id="bet_index_amount"></div>
            </div>
            <div class="col-md-6">
                <div id="win_index"></div>
            </div>
        </div>
    </div>
</div>
</section>
